cmake_minimum_required(VERSION 3.15 FATAL_ERROR)

project(exercis-cpp LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_executable(errorTest main.cpp erroTest.cpp erroTest.h)

list(APPEND flags "-fsanitize=address" "-O1" "-fno-omit-frame-pointer" "-g")

target_compile_options(errorTest
        PRIVATE
        ${flags}
        )

target_link_libraries(errorTest
        PRIVATE
        -fsanitize=address
        )
